<?php
    $admin = $_GET['admin']; //获取账号
    $password = $_GET['password'];  //获取密码
    //连接数据库
    $_conn = new mysqli("localhost","root","","dy");
    if($_conn->connect_error){
        exit("数据库连接失败");
    }
    $_conn->set_charset("utf8");
    //验证账号密码
    $sql = "select * from user where admin = '$admin' and password = '$password'";
    $login_sel = $_conn->query($sql)->fetch_assoc(); //获取到的数据
    if($login_sel){
        $obj = array();
        $obj["admin"] = $admin;
        $obj["zt"] = "1";
        echo json_encode($obj);
    }else{
        echo "0";
    }
?>